import Vue from "vue";
import VueX from "vuex";
import axios from "axios";

Vue.use(VueX);
export default new VueX.Store({
  state: {
    showList: [],
    total: 0,
  },
  mutations: {
    UPDATA_SHOWLIST(state, data) {
      state.showList = data.result;
      state.total = data.total;
    },
  },
  actions: {
    async getShowListApi({ commit }, { currentPage, area }) {
      const res = await axios({
        url: `/api/ticket/project/listV2?version=134&page=${currentPage}&pagesize=16&area=${area}&filter=&platform=web&p_type=%E5%85%A8%E9%83%A8%E7%B1%BB%E5%9E%8B`,
        method: "get",
      });
      commit("UPDATA_SHOWLIST", res.data.data);
    },
  },
});
